const { app } = require('electron')
const createCore = require('./core.cjs')

let mainWindow = null
const { windows, createWindow, bindMessagePort } = createCore.getCreateWindowInstance(5)

function createMainWindow() {
  mainWindow = createWindow('http://localhost:3000')
  bindMessagePort(mainWindow)
}

app.whenReady().then(async () => {
  createMainWindow()
})

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit()
})
